# 使用deepseek大模型实例


import os
from openai import OpenAI

api_key = os.getenv("DEEPSEEK_API_KEY")
base_url = os.getenv("DEEPSEEK_BASE_URL")

#引入openai sdk
llm = OpenAI(api_key = api_key, base_url = base_url)

response = llm.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "帮我写一篇关于AI的技术文章，100个字"},
    ],
    stream=False
)

print("\n")
print(response.choices[0].message.content)